; AESOP


; misc. crap

(defun put (SYM PROP VAL)
  (setf (get SYM PROP)
	VAL))

(defun nil-zero (N)
  (if (null N) 0
      N))

; useful things


(defconstant *null-event*
  NIL)

(defun roll-for (EVENT)
  (<= (random 1.0)
      (nil-zero (get EVENT 
		     'PROB))))

(defun bayesian-if (EVENT)
  (if (roll-for EVENT) 
      EVENT
      *null-event*))

; basic bayesian primitives?
;
; B(X, Y) = P(X|Y)
;
; T = B(T, *) = 1
; F = B(F, *) = 0
; A -> B:
;   B(B, A) = 1


; notes

; state-matrix
; behavior-matrix
; sensory-matrix
; extshape-matrix
; behavior/shape-correspondence-matrix
